// pages/carVehicels/carVehicels.js
var a = getApp();
Page({

    /**
     * 页面的初始数据
     */
  data: {
        car:'',
        xiugai:'',
        id: 0,
        name: '',
        classes: [], //车系list
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(e) {
        console.log(e)
        this.setData({
            id: e.id,
            name: e.name,
            xiugai:e.xiugai,
            car:e.car
        })
        var t = wx.getSystemInfoSync(),
            e = this;
        a.util.request({
            url: "entry/wxapp/Api",
            data: {
                m: "monai_market",
                r: "sale.index.carVehicels",
                brand_id: e.data.id
            },
            cachetime: "0",
            success: function(a) {
                console.log(a), e.setData({
                    classes: a.data.data,
                    max_height: t.windowHeight
                });
            }
        });

    },
    carMotoType: function(e) {
        var t = this
        console.log(e)
        var id = e.currentTarget.dataset.id
        var name = e.currentTarget.dataset.name
      wx.navigateTo({
          url: '../carMotoType/carMotoType?id=' + id + '&name=' + name + '&ppname=' + t.data.name + '&ppid=' + t.data.id + "&xiugai=" + t.data.xiugai + "&car=" + t.data.car
        })
    }
})